// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
/**
 * 积分商城--banner和金刚区
 */
export function getIntegralHome() {
  return uni.http({
    url: 'points/home',
    noAuth: true,
    requestType: 'shop',
  })
}
/**
 * 积分商城--积分兑换区间
 */
export function getIntegralScope() {
  return uni.http({
    url: 'points/scope',
    noAuth: true,
    requestType: 'shop',
  })
}
/**
 * 积分商城--商品列表
 */
export function getIntegralGoodsList(data) {
  return uni.http({
    url: 'points/lst',
    data,
    requestType: 'shop',
    noAuth: true,
  })
}
/**
 * 积分商城--商品列表
 */
export function getIntegralProductDetail(id) {
  return uni.http({
    url: `points/detail/${id}`,
    noAuth: true,
    requestType: 'shop',
  })
}
/**
 * 积分商城--生成订单
 */
export function integralOrderConfirm(data) {
  return uni.http({
    url: 'order/v3/check',
    method: 'post',
    data,
    noAuth: true,
    requestType: 'shop',
  })
}
/**
 * 积分商城--下单
 */
export function integralOrderCreate(data) {
  return uni.http({
    url: 'order/v3/create',
    method: 'POST',
    data,
    noAuth: true,
    requestType: 'shop',
  })
}
/**
 * 积分商城--订单列表
 */
export function integralOrderList(data) {
  return uni.http({
    url: 'points/order/lst',
    data,
    noAuth: true,
    requestType: 'shop',
  })
}
/**
 * 积分商城--订单详情
 */
export function integralOrderDetail(id) {
  return uni.http({
    url: `points/order/detail/${id}`,
    noAuth: true,
    requestType: 'shop',
  })
}
/**
 * 积分商城--订单详情
 */
export function integralOrderTake(id) {
  return uni.http({
    url: `points/order/take/${id}`,
    method: 'POST',
    noAuth: true,
    requestType: 'shop',
  })
}
/**
 * 积分商城--删除
 */
export function integralOrderDelete(id) {
  return uni.http({
    url: `points/order/deleate/${id}`,
    method: 'POST',
    noAuth: true,
    requestType: 'shop',
  })
}

export function integralOrderCencel(id) {
  return uni.http({
    url: `order/cancel/${id}`,
    method: 'POST',
    noAuth: true,
    requestType: 'shop',
  })
}
